<%@ page contentType="text/html; charset=utf-8" language="java" import="java.util.*" pageEncoding="utf-8" errorPage="" %>
<%@ page import="club325.webchat.servlet.log.SessionAttributeManager" %>
<%@ page import="club325.webchat.servlet.user.UserInfoManager" %>
<%@ page session="false" %>

<%
	String username = SessionAttributeManager.getUserName(request);
	List<String> friendsList = UserInfoManager.getFriendsList(username);
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/frame.dwt.jsp" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<meta http-equiv="Keywords" content="Microblog,Vioce,blog" />
<meta http-equiv="Description" content="Voice Microblog" />

<!-- InstanceBeginEditable name="doctitle" -->
<title>管理好友</title>
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="head" -->
<link href="/Microblog/styles/user_friends.css" rel="stylesheet" type="text/css" />
<!-- InstanceEndEditable -->
<link href="/Microblog/styles/global.css" rel="stylesheet" type="text/css" />
<link href="/Microblog/styles/blank.css" rel="stylesheet" type="text/css" />
</head>

<body>
<div class="main">
<!-- InstanceBeginEditable name="EditRegion_main" -->
  <h1>管理我的好友...</h1>
  <h5>查找用户</h5>
  <form id="form_friends" name="form_friends" method="post" action="#" onsubmit="#">
  <table width="450" border="0" cellpadding="0" cellspacing="8" class="search">
    <tr>
      <th width="120" scope="row">所查找的用户名 :</th>
      <td width="300">
        <input type="text" name="name" id="name" value=""/>
        <input type="submit" name="submit" id="submit" value="查找" />
      </td>
    </tr>
  </table>
  </form>
  <h5>我的好友</h5>
  <div class="list">
    <table width="420" border="0" cellspacing="0" cellpadding="0" class="friend_list">
      <tr>
        <th width="230" scope="col">用户名</th>
        <th colspan="2" scope="col">操作</th>
      </tr>
      <%
    	if (friendsList == null || friendsList.isEmpty()) {
      %>
      <tr>
       	<td colspan="3">暂无信息</td>
      </tr>
      <%
    	} else {
    		for (String fre : friendsList) {
      %>
      <tr>
        <td><%= fre %></td>
        <td width="120"><a href="#">查看信息</a></td>
        <td width="70"><a href="#">删除</a></td>
      </tr>
      <%
    		}
    	}
      %>
    </table>
  </div>
  <div id="bottom"></div>
<!-- InstanceEndEditable -->
</div>
</body>
<!-- InstanceEnd --></html>
